<?php
namespace BP\En;
require_once("java/util/ArrayList.php");
require_once("java/util/Date.php");
require_once("java/util/List.php");
require_once("BP/DA/AtPara.php");
require_once("BP/DA/DataType.php");
class Attrs extends ArrayList {
	protected static $serialVersionUID;	// long
	public static function __staticinit() { // static class members
		self::$serialVersionUID = 1;
	}
	public static function convertAttrs ($obj) // [Object obj]
	{
		return $obj;
	}
	public function ToJavaList () 
	{
		return $this;
	}
	protected function AddTBString_String_String_Object_FieldType_String_b_b_I_I_I ($key, $field, $defaultVal, $_FieldType, $desc, $uiVisable, $isReadonly, $minLength, $maxLength, $tbWith) // [String key, String field, Object defaultVal, FieldType _FieldType, String desc, boolean uiVisable, boolean isReadonly, int minLength, int maxLength, int tbWith]
	{
		$attr = Attr::constructor__();
		$attr->setKey($key);
		$attr->setField($field);
		$attr->setDefaultVal($defaultVal);
		$attr->setMyDataType($DataType->AppString);
		$attr->setDesc($desc);
		$attr->setUIVisible($uiVisable);
		$attr->setUIWidth($tbWith);
		$attr->setUIIsReadonly($isReadonly);
		$attr->setMaxLength($maxLength);
		$attr->setMinLength($minLength);
		$attr->setMyFieldType($_FieldType);
			/* match: Attr */
		$this->Add_Attr($attr);
	}
	public function AddTBString_String_String_String_b_b_I_I_I ($key, $defaultVal, $desc, $uiVisable, $isReadonly, $minLength, $maxLength, $tbWith) // [String key, String defaultVal, String desc, boolean uiVisable, boolean isReadonly, int minLength, int maxLength, int tbWith]
	{
			/* match: String_String_Object_FieldType_String_b_b_I_I_I */
		$this->AddTBString_String_String_Object_FieldType_String_b_b_I_I_I($key, $key, $defaultVal, FieldType::$Normal, $desc, $uiVisable, $isReadonly, $minLength, $maxLength, $tbWith);
	}
	public function AddTBString_String_String_Object_String_b_b_I_I_I ($key, $field, $defaultVal, $desc, $uiVisable, $isReadonly, $minLength, $maxLength, $tbWith) // [String key, String field, Object defaultVal, String desc, boolean uiVisable, boolean isReadonly, int minLength, int maxLength, int tbWith]
	{
			/* match: String_String_Object_FieldType_String_b_b_I_I_I */
		$this->AddTBString_String_String_Object_FieldType_String_b_b_I_I_I($key, $field, $defaultVal, FieldType::$Normal, $desc, $uiVisable, $isReadonly, $minLength, $maxLength, $tbWith);
	}
	public function AddTBStringDoc_String_String_String_b_b ($key, $defaultVal, $desc, $uiVisable, $isReadonly) // [String key, String defaultVal, String desc, boolean uiVisable, boolean isReadonly]
	{
			/* match: String_String_String_String_b_b_I_I_I_I */
		$this->AddTBStringDoc_String_String_String_String_b_b_I_I_I_I($key, $key, $defaultVal, $desc, $uiVisable, $isReadonly, 0, 2000, 300, 300);
	}
	public function AddTBStringDoc_String_String_String_b_b_I_I_I_I ($key, $defaultVal, $desc, $uiVisable, $isReadonly, $minLength, $maxLength, $tbWith, $rows) // [String key, String defaultVal, String desc, boolean uiVisable, boolean isReadonly, int minLength, int maxLength, int tbWith, int rows]
	{
			/* match: String_String_String_String_b_b_I_I_I_I */
		$this->AddTBStringDoc_String_String_String_String_b_b_I_I_I_I($key, $key, $defaultVal, $desc, $uiVisable, $isReadonly, $minLength, $maxLength, $tbWith, $rows);
	}
	public function AddTBStringDoc_String_String_String_String_b_b_I_I_I_I ($key, $field, $defaultVal, $desc, $uiVisable, $isReadonly, $minLength, $maxLength, $tbWith, $rows) // [String key, String field, String defaultVal, String desc, boolean uiVisable, boolean isReadonly, int minLength, int maxLength, int tbWith, int rows]
	{
		$attr = Attr::constructor__();
		$attr->setKey($key);
		$attr->setField($field);
		$attr->setDefaultVal($defaultVal);
		$attr->setMyDataType($DataType->AppString);
		$attr->setDesc($desc);
		$attr->setUIVisible($uiVisable);
		$attr->setUIWidth(300);
		$attr->setUIIsReadonly($isReadonly);
		$attr->setMaxLength($maxLength);
		$attr->setMinLength($minLength);
		$attr->setMyFieldType(FieldType::$Normal);
		$attr->setUIHeight($rows);
			/* match: Attr */
		$this->Add_Attr($attr);
	}
	public function AddMyFile ($fileDesc) // [String fileDesc]
	{
			/* match: String_String_String_b_b_I_I_I */
		$this->AddTBString_String_String_String_b_b_I_I_I(EntityNoMyFileAttr::$MyFileName, NULL, $fileDesc,  FALSE ,  FALSE , 0, 100, 200);
			/* match: String_String_String_b_b_I_I_I */
		$this->AddTBString_String_String_String_b_b_I_I_I(EntityNoMyFileAttr::$MyFilePath, NULL, "MyFilePath",  FALSE ,  FALSE , 0, 100, 200);
			/* match: String_String_String_b_b_I_I_I */
		$this->AddTBString_String_String_String_b_b_I_I_I(EntityNoMyFileAttr::$MyFileExt, NULL, "MyFileExt",  FALSE ,  FALSE , 0, 10, 10);
			/* match: String_I_String_b_b */
		$this->AddTBInt_String_I_String_b_b(EntityNoMyFileAttr::$MyFileH, 0, "MyFileH",  FALSE ,  FALSE );
			/* match: String_I_String_b_b */
		$this->AddTBInt_String_I_String_b_b(EntityNoMyFileAttr::$MyFileW, 0, "MyFileW",  FALSE ,  FALSE );
			/* match: String_I_String_b_b */
		$this->AddTBInt_String_I_String_b_b("MyFileSize", 0, "MyFileSize",  FALSE ,  FALSE );
	}
	public function AddTBInt_String_String_I_String_b_b ($key, $_Field, $defaultVal, $desc, $uiVisable, $isReadonly) // [String key, String _Field, int defaultVal, String desc, boolean uiVisable, boolean isReadonly]
	{
		$attr = Attr::constructor__();
		$attr->setKey($key);
		$attr->setField($_Field);
		$attr->setDefaultVal($defaultVal);
		$attr->setMyDataType($DataType->AppInt);
		$attr->setMyFieldType(FieldType::$Normal);
		$attr->setDesc($desc);
		$attr->setUIVisible($uiVisable);
		$attr->setUIIsReadonly($isReadonly);
			/* match: Attr */
		$this->Add_Attr($attr);
	}
	public function AddTBInt_String_I_String_b_b ($key, $defaultVal, $desc, $uiVisable, $isReadonly) // [String key, int defaultVal, String desc, boolean uiVisable, boolean isReadonly]
	{
			/* match: String_String_I_String_b_b */
		$this->AddTBInt_String_String_I_String_b_b($key, $key, $defaultVal, $desc, $uiVisable, $isReadonly);
	}
	public function AddBoolen ($key, $defaultVal, $desc) // [String key, boolean defaultVal, String desc]
	{
		$attr = Attr::constructor__();
		$attr->setKey($key);
		$attr->setField($key);
		if ($defaultVal)
		{
			$attr->setDefaultVal(1);
		}
		else
		{
			$attr->setDefaultVal(0);
		}
		$attr->setMyDataType($DataType->AppBoolean);
		$attr->setDesc($desc);
		$attr->setUIContralType(UIContralType::$CheckBok);
		$attr->setUIIsReadonly( TRUE );
		$attr->setUIVisible( TRUE );
			/* match: Attr */
		$this->Add_Attr($attr);
	}
	public function AddTBFloat_String_String_F_String_b_b ($key, $_Field, $defaultVal, $desc, $uiVisable, $isReadonly) // [String key, String _Field, float defaultVal, String desc, boolean uiVisable, boolean isReadonly]
	{
		$attr = Attr::constructor__();
		$attr->setKey($key);
		$attr->setField($_Field);
		$attr->setDefaultVal($defaultVal);
		$attr->setMyDataType($DataType->AppFloat);
		$attr->setDesc($desc);
		$attr->setUIVisible($uiVisable);
		$attr->setUIIsReadonly($isReadonly);
			/* match: Attr */
		$this->Add_Attr($attr);
	}
	public function AddTBFloat_String_F_String_b_b ($key, $defaultVal, $desc, $uiVisable, $isReadonly) // [String key, float defaultVal, String desc, boolean uiVisable, boolean isReadonly]
	{
			/* match: String_String_F_String_b_b */
		$this->AddTBFloat_String_String_F_String_b_b($key, $key, $defaultVal, $desc, $uiVisable, $isReadonly);
	}
	public function AddTBDecimal_String_String_BigDecimalmathjava_String_b_b ($key, $_Field, $defaultVal, $desc, $uiVisable, $isReadonly) // [String key, String _Field, java.math.BigDecimal defaultVal, String desc, boolean uiVisable, boolean isReadonly]
	{
		$attr = Attr::constructor__();
		$attr->setKey($key);
		$attr->setField($_Field);
		$attr->setDefaultVal($defaultVal);
		$attr->setMyDataType($DataType->AppDouble);
		$attr->setDesc($desc);
		$attr->setUIVisible($uiVisable);
		$attr->setUIIsReadonly($isReadonly);
			/* match: Attr */
		$this->Add_Attr($attr);
	}
	public function AddTBDecimal_String_BigDecimalmathjava_String_b_b ($key, $defaultVal, $desc, $uiVisable, $isReadonly) // [String key, java.math.BigDecimal defaultVal, String desc, boolean uiVisable, boolean isReadonly]
	{
			/* match: String_String_BigDecimalmathjava_String_b_b */
		$this->AddTBDecimal_String_String_BigDecimalmathjava_String_b_b($key, $key, $defaultVal, $desc, $uiVisable, $isReadonly);
	}
	public function AddTBDate_String_String_String_String_b_b ($key, $field, $defaultVal, $desc, $uiVisable, $isReadonly) // [String key, String field, String defaultVal, String desc, boolean uiVisable, boolean isReadonly]
	{
		$attr = Attr::constructor__();
		$attr->setKey($key);
		$attr->setField($field);
		$attr->setDefaultVal($defaultVal);
		$attr->setMyDataType($DataType->AppDate);
		$attr->setDesc($desc);
		$attr->setUIVisible($uiVisable);
		$attr->setUIIsReadonly($isReadonly);
		$attr->setMaxLength(20);
			/* match: Attr */
		$this->Add_Attr($attr);
	}
	public function AddTBDate_String_String_String_b_b ($key, $defaultVal, $desc, $uiVisable, $isReadonly) // [String key, String defaultVal, String desc, boolean uiVisable, boolean isReadonly]
	{
			/* match: String_String_String_String_b_b */
		$this->AddTBDate_String_String_String_String_b_b($key, $key, $defaultVal, $desc, $uiVisable, $isReadonly);
	}
	public function AddTBDate_String_String_b_b ($key, $desc, $uiVisable, $isReadonly) // [String key, String desc, boolean uiVisable, boolean isReadonly]
	{
			/* match: String_String_String_String_b_b */
		$this->AddTBDate_String_String_String_String_b_b($key, $key, $DataType->dateToStr(new Date(), $DataType->getSysDataFormat()), $desc, $uiVisable, $isReadonly);
	}
	public function AddTBDateTime_String_String_String_String_b_b ($key, $field, $defaultVal, $desc, $uiVisable, $isReadonly) // [String key, String field, String defaultVal, String desc, boolean uiVisable, boolean isReadonly]
	{
		$attr = Attr::constructor__();
		$attr->setKey($key);
		$attr->setField($field);
		$attr->setDefaultVal($defaultVal);
		$attr->setMyDataType($DataType->AppDateTime);
		$attr->setDesc($desc);
		$attr->setUIVisible($uiVisable);
		$attr->setUIIsReadonly($isReadonly);
		$attr->setMaxLength(30);
		$attr->setMinLength(0);
		$attr->setUIWidth(100);
			/* match: Attr */
		$this->Add_Attr($attr);
	}
	public function AddTBDateTime_String_String_String_b_b ($key, $defaultVal, $desc, $uiVisable, $isReadonly) // [String key, String defaultVal, String desc, boolean uiVisable, boolean isReadonly]
	{
			/* match: String_String_String_String_b_b */
		$this->AddTBDateTime_String_String_String_String_b_b($key, $key, $defaultVal, $desc, $uiVisable, $isReadonly);
	}
	public function AddTBDateTime_String_String_b_b ($key, $desc, $uiVisable, $isReadonly) // [String key, String desc, boolean uiVisable, boolean isReadonly]
	{
			/* match: String_String_String_String_b_b */
		$this->AddTBDateTime_String_String_String_String_b_b($key, $key, $DataType->dateToStr(new Date(), $DataType->getSysDataTimeFormat()), $desc, $uiVisable, $isReadonly);
	}
	public function AddDDLSysEnum_String_I_String_b_b_String ($key, $defaultVal, $desc, $isUIVisable, $isUIEnable, $sysEnumKey) // [String key, int defaultVal, String desc, boolean isUIVisable, boolean isUIEnable, String sysEnumKey]
	{
			/* match: String_String_I_String_b_b_String_String */
		$this->AddDDLSysEnum_String_String_I_String_b_b_String_String($key, $key, $defaultVal, $desc, $isUIVisable, $isUIEnable, $sysEnumKey, NULL);
	}
	public function AddDDLSysEnum_String_String_I_String_b_b_String ($key, $field, $defaultVal, $desc, $isUIVisable, $isUIEnable, $sysEnumKey) // [String key, String field, int defaultVal, String desc, boolean isUIVisable, boolean isUIEnable, String sysEnumKey]
	{
			/* match: String_String_I_String_b_b_String_String */
		$this->AddDDLSysEnum_String_String_I_String_b_b_String_String($key, $field, $defaultVal, $desc, $isUIVisable, $isUIEnable, $sysEnumKey, NULL);
	}
	public function AddDDLSysEnum_String_String_I_String_b_b_String_String ($key, $field, $defaultVal, $desc, $isUIVisable, $isUIEnable, $sysEnumKey, $cfgVal) // [String key, String field, int defaultVal, String desc, boolean isUIVisable, boolean isUIEnable, String sysEnumKey, String cfgVal]
	{
		$attr = Attr::constructor__();
		$attr->setKey($key);
		$attr->setField($field);
		$attr->setDefaultVal($defaultVal);
		$attr->setMyDataType($DataType->AppInt);
		$attr->setMyFieldType(FieldType::$Enum);
		$attr->setDesc($desc);
		$attr->setUIContralType(UIContralType::$DDL);
		$attr->setUIBindKey($sysEnumKey);
		$attr->UITag = $cfgVal;
		$attr->setUIVisible($isUIVisable);
		$attr->setUIIsReadonly($isUIEnable);
			/* match: Attr */
		$this->Add_Attr($attr);
	}
	public function AddDDLSysEnum_String_I_String_b_b_String_String ($key, $defaultVal, $desc, $isUIVisable, $isUIEnable, $sysEnumKey, $cfgVals) // [String key, int defaultVal, String desc, boolean isUIVisable, boolean isUIEnable, String sysEnumKey, String cfgVals]
	{
			/* match: String_String_I_String_b_b_String_String */
		$this->AddDDLSysEnum_String_String_I_String_b_b_String_String($key, $key, $defaultVal, $desc, $isUIVisable, $isUIEnable, $sysEnumKey, $cfgVals);
	}
	public function AddDDLSysEnum_String_I_String_b_b ($key, $defaultVal, $desc, $isUIVisable, $isUIEnable) // [String key, int defaultVal, String desc, boolean isUIVisable, boolean isUIEnable]
	{
		$this->AddDDLSysEnum_String_String_I_String_b_b_String($key, $key, $defaultVal, $desc, $isUIVisable, $isUIEnable, $key);
	}
	public function AddDDLSQL ($key, $defaultVal, $desc, $sql, $uiIsEnable) // [String key, Object defaultVal, String desc, String sql, boolean uiIsEnable]
	{
		if (($defaultVal == NULL))
		{
			$defaultVal = "";
		}
		$attr = Attr::constructor__();
		$attr->setKey($key);
		$attr->setField($key);
		if ($defaultVal instanceof Integer)
		{
			$attr->setDefaultVal($defaultVal);
			$attr->setMyDataType($DataType->AppInt);
		}
		else
		{
			$attr->setDefaultVal($defaultVal);
			$attr->setMyDataType($DataType->AppString);
		}
		$attr->setMyFieldType(FieldType::$Normal);
		$attr->setMaxLength(50);
		$attr->setDesc($desc);
		$attr->setUIContralType(UIContralType::$DDL);
		$attr->setUIDDLShowType(DDLShowType::$BindSQL);
		$attr->setUIBindKey($sql);
		$attr->setHisFKEns(NULL);
		$attr->setUIIsReadonly(!$uiIsEnable);
			/* match: Attr */
		$this->Add_Attr($attr);
		$attr = Attr::constructor__();
		$attr->setKey(($key . "Text"));
		$attr->setField(($key . "Text"));
		$attr->setDefaultVal($defaultVal);
		$attr->setMyDataType($DataType->AppString);
		$attr->setMyFieldType(FieldType::$RefText);
		$attr->setMaxLength(200);
		$attr->setDesc($desc);
		$attr->setUIContralType(UIContralType::$TB);
		$attr->setUIIsReadonly( TRUE );
		$attr->setUIVisible( FALSE );
			/* match: Attr */
		$this->Add_Attr($attr);
	}
	public function AddDDLEntities_String_String_Object_I_FieldType_String_Entities_String_String_b ($key, $field, $defaultVal, $dataType, $_fildType, $desc, $ens, $refKey, $refText, $uiIsEnable) // [String key, String field, Object defaultVal, int dataType, FieldType _fildType, String desc, Entities ens, String refKey, String refText, boolean uiIsEnable]
	{
		$attr = Attr::constructor__();
		$attr->setKey($key);
		$attr->setField($field);
		$attr->setDefaultVal($defaultVal);
		$attr->setMyDataType($dataType);
		$attr->setMyFieldType($_fildType);
		$attr->setDesc($desc);
		$attr->setUIContralType(UIContralType::$DDL);
		$attr->setUIBindKey($ens);
		$attr->setHisFKEns($ens);
		$attr->setHisFKEns($ens);
		$attr->setUIRefKeyText($refText);
		$attr->setUIRefKeyValue($refKey);
		$attr->setUIIsReadonly($uiIsEnable);
			/* match: Attr_b_b */
		$this->Add_Attr_b_b($attr,  TRUE ,  FALSE );
	}
	public function AddDDLEntities_String_String_Object_I_String_Entities_String_String_b ($key, $field, $defaultVal, $dataType, $desc, $ens, $refKey, $refText, $uiIsEnable) // [String key, String field, Object defaultVal, int dataType, String desc, Entities ens, String refKey, String refText, boolean uiIsEnable]
	{
			/* match: String_String_Object_I_FieldType_String_Entities_String_String_b */
		$this->AddDDLEntities_String_String_Object_I_FieldType_String_Entities_String_String_b($key, $field, $defaultVal, $dataType, FieldType::$FK, $desc, $ens, $refKey, $refText, $uiIsEnable);
	}
	public function AddDDLEntities_String_Object_I_String_Entities_String_String_b ($key, $defaultVal, $dataType, $desc, $ens, $refKey, $refText, $uiIsEnable) // [String key, Object defaultVal, int dataType, String desc, Entities ens, String refKey, String refText, boolean uiIsEnable]
	{
			/* match: String_String_Object_I_String_Entities_String_String_b */
		$this->AddDDLEntities_String_String_Object_I_String_Entities_String_String_b($key, $key, $defaultVal, $dataType, $desc, $ens, $refKey, $refText, $uiIsEnable);
	}
	public function AddDDLEntities_String_Object_String_EntitiesNoName_b ($key, $defaultVal, $desc, $ens, $uiIsEnable) // [String key, Object defaultVal, String desc, EntitiesNoName ens, boolean uiIsEnable]
	{
			/* match: String_String_Object_I_String_Entities_String_String_b */
		$this->AddDDLEntities_String_String_Object_I_String_Entities_String_String_b($key, $key, $defaultVal, $DataType->AppString, $desc, $ens, "No", "Name", $uiIsEnable);
	}
	public function AddDDLEntities_String_String_Object_String_EntitiesNoName_b ($key, $field, $defaultVal, $desc, $ens, $uiIsEnable) // [String key, String field, Object defaultVal, String desc, EntitiesNoName ens, boolean uiIsEnable]
	{
			/* match: String_String_Object_I_String_Entities_String_String_b */
		$this->AddDDLEntities_String_String_Object_I_String_Entities_String_String_b($key, $field, $defaultVal, $DataType->AppString, $desc, $ens, "No", "Name", $uiIsEnable);
	}
	public function AddDDLEntities_String_Object_String_EntitiesTree_b ($key, $defaultVal, $desc, $ens, $uiIsEnable) // [String key, Object defaultVal, String desc, EntitiesTree ens, boolean uiIsEnable]
	{
			/* match: String_String_Object_I_String_Entities_String_String_b */
		$this->AddDDLEntities_String_String_Object_I_String_Entities_String_String_b($key, $key, $defaultVal, $DataType->AppString, $desc, $ens, "No", "Name", $uiIsEnable);
	}
	public function AddDDLEntities_String_Object_String_EntitiesOIDName_b ($key, $defaultVal, $desc, $ens, $uiIsEnable) // [String key, Object defaultVal, String desc, EntitiesOIDName ens, boolean uiIsEnable]
	{
			/* match: String_String_Object_I_String_Entities_String_String_b */
		$this->AddDDLEntities_String_String_Object_I_String_Entities_String_String_b($key, $key, $defaultVal, $DataType->AppInt, $desc, $ens, "OID", "Name", $uiIsEnable);
	}
	public function AddDDLEntities_String_String_Object_String_EntitiesOIDName_b ($key, $field, $defaultVal, $desc, $ens, $uiIsEnable) // [String key, String field, Object defaultVal, String desc, EntitiesOIDName ens, boolean uiIsEnable]
	{
			/* match: String_String_Object_I_String_Entities_String_String_b */
		$this->AddDDLEntities_String_String_Object_I_String_Entities_String_String_b($key, $field, $defaultVal, $DataType->AppInt, $desc, $ens, "OID", "Name", $uiIsEnable);
	}
	public function clone () 
	{
		$attrs = Attrs::constructor__();
		foreach ($this as $attr) 		{
			/* match: Attr */
			$attrs->Add_Attr($attr);
		}
		return $attrs;
	}
	public function NextAttr ($CurrentKey) // [String CurrentKey]
	{
		$i = $this->GetIndexByKey($CurrentKey);
		if (($this->size() > $i))
		{
			return NULL;
		}
		$tempVar = $this->getItem(($i + 1));
		return (( (($tempVar instanceof Attr)) ? $tempVar : NULL ));
	}
	public function PrvAttr ($CurrentKey) // [String CurrentKey]
	{
		$i = $this->GetIndexByKey($CurrentKey);
		if (($this->size() < $i))
		{
			return NULL;
		}
		$tempVar = $this->getItem(($i - 1));
		return (( (($tempVar instanceof Attr)) ? $tempVar : NULL ));
	}
	public function Contains ($key) // [String key]
	{
		foreach ($this as $attr) 		{
			if ($attr->getKey()->equals($key))
			{
				return  TRUE ;
			}
		}
		return  FALSE ;
	}
	public function ContainsUpper ($key) // [String key]
	{
		foreach ($this as $attr) 		{
			if ($attr->getKey()->toUpperCase()->equals($key->toUpperCase()))
			{
				return  TRUE ;
			}
		}
		return  FALSE ;
	}
	public function getConutOfPhysicsFields () 
	{
		$i = 0;
		foreach ($this as $attr) 		{
			if (($attr->getMyFieldType() != FieldType::$RefText))
			{
				++$i;
			}
		}
		return $i;
	}
	public function GetIndexByKey ($key) // [String key]
	{
		for ($i = 0; ($i < $this->size()); ++$i) 
		{
			if ($this->getItem($i)->getKey()->equals($key))
			{
				return $i;
			}
		}
		return -1;
	}
	public function GetAttrByKey ($key) // [String key]
	{
		foreach ($this as $item) 		{
			if ($item->getKey()->equals($key))
			{
				return $item;
			}
		}
		return NULL;
	}
	public static function constructor__String ($cfgKeys) // [String cfgKeys]
	{
		$me = new self();
		$strs = $cfgKeys->split("[@]", -1);
		foreach ($strs as $str) 		{
			$ap = new AtPara($str->replace(";", "@"));
			$ft = FieldTypeS->forValue($ap->GetValIntByKey("AppType"));
			switch ($ft) {
				case $Enum:
			/* match: String_String_I_String_b_b_String_String */
					$me->AddDDLSysEnum_String_String_I_String_b_b_String_String($ap->GetValStrByKey("Key"), $ap->GetValStrByKey("Key"), $ap->GetValIntByKey("DefVal"), $ap->GetValStrByKey("Name"),  TRUE ,  TRUE , $ap->GetValStrByKey("Key"), ("@" . $ap->GetValStrByKey("BindKey")->replace(",", "@")));
					break;
				case $FK:
					$ens = $BP->En->ClassFactory->GetEns($ap->GetValStrByKey("BindKey"));
					$me->AddDDLEntities_String_Object_String_EntitiesNoName_b($ap->GetValStrByKey("Key"), $ap->GetValStrByKey("DefVal"), $ap->GetValStrByKey("Name"), $ens,  TRUE );
					break;
				default:
					if ($ap->GetValStrByKey("Type")->equals("String"))
					{
			/* match: String_String_String_b_b_I_I_I */
						$me->AddTBString_String_String_String_b_b_I_I_I($ap->GetValStrByKey("Key"), $ap->GetValStrByKey("DefVal"), $ap->GetValStrByKey("Name"),  TRUE ,  FALSE , 0, 1000, 500);
					}
					else
						if ($ap->GetValStrByKey("Type")->equals("Int"))
						{
			/* match: String_I_String_b_b */
							$me->AddTBInt_String_I_String_b_b($ap->GetValStrByKey("Key"), $ap->GetValIntByKey("DefVal"), $ap->GetValStrByKey("Name"),  TRUE ,  FALSE );
						}
						else
							if ($ap->GetValStrByKey("Type")->equals("Float"))
							{
			/* match: String_F_String_b_b */
								$me->AddTBFloat_String_F_String_b_b($ap->GetValStrByKey("Key"), $ap->GetValFloatByKey("DefVal"), $ap->GetValStrByKey("Name"),  TRUE ,  FALSE );
							}
							else
					break;
			}
		}
		return $me;
	}
	public static function constructor__ () 
	{
		$me = new self();
		return $me;
	}
	public function Add_Attr ($attr) // [Attr attr]
	{
		if ((($attr->getField() . NULL) . $attr->getField()->equals("")))
		{
			throw new \RuntimeException((("@属�?�设置错误：您不能设�? key='" . $attr->getKey()) . "',得字段�?�为�?"));
		}
		$k = $attr->getIsKeyEqualField();
			/* match: Attr_b_b */
		$this->Add_Attr_b_b($attr,  TRUE ,  FALSE );
	}
	public function Add_Attr_b_b ($attr, $isAddHisRefText, $isAddHisRefName) // [Attr attr, boolean isAddHisRefText, boolean isAddHisRefName]
	{
		foreach ($this as $myattr) 		{
			if ($myattr->getKey()->equals($attr->getKey()))
				return ;
		}
		$this->add($attr);
		if ($isAddHisRefText)
		{
			$this->AddRefAttrText($attr);
		}
		if ($isAddHisRefName)
		{
			$this->AddRefAttrName($attr);
		}
	}
	protected function AddRefAttrText ($attr) // [Attr attr]
	{
		if ((((($attr->getMyFieldType() == FieldType::$FK) || ($attr->getMyFieldType() == FieldType::$Enum)) || ($attr->getMyFieldType() == FieldType::$PKEnum)) || ($attr->getMyFieldType() == FieldType::$PKFK)))
		{
			$myattr = Attr::constructor__();
			$myattr->setMyFieldType(FieldType::$RefText);
			$myattr->setMyDataType($DataType->AppString);
			$myattr->setUIContralType(UIContralType::$TB);
			$myattr->setUIWidth(($attr->getUIWidth() * 2));
			$myattr->setKey(($attr->getKey() . "Text"));
			$myattr->setUIIsReadonly( TRUE );
			$myattr->setUIBindKey($attr->getUIBindKey());
			$myattr->setHisFKEns($attr->getHisFKEns());
			$desc = "名称";
			$myattr->setDesc($desc);
			if (($desc->indexOf("编号") >= 0))
			{
				$myattr->setDesc($attr->getDesc()->replace("编号", "名称"));
			}
			else
			{
				$myattr->setDesc(($attr->getDesc() . "名称"));
			}
			if (($attr->getUIContralType() == UIContralType::$DDL))
			{
				$myattr->setUIVisible( FALSE );
			}
			$this->add($myattr);
		}
	}
	protected function AddRefAttrName ($attr) // [Attr attr]
	{
		if ((((($attr->getMyFieldType() == FieldType::$FK) || ($attr->getMyFieldType() == FieldType::$Enum)) || ($attr->getMyFieldType() == FieldType::$PKEnum)) || ($attr->getMyFieldType() == FieldType::$PKFK)))
		{
			$myattr = Attr::constructor__();
			$myattr->setMyFieldType(FieldType::$Normal);
			$myattr->setMyDataType($DataType->AppString);
			$myattr->setUIContralType(UIContralType::$TB);
			$myattr->setUIWidth(($attr->getUIWidth() * 2));
			$myattr->setKey(($attr->getKey() . "Name"));
			$myattr->setField(($attr->getKey() . "Name"));
			$myattr->setMaxLength(200);
			$myattr->setMinLength(0);
			$myattr->setUIVisible( FALSE );
			$myattr->setUIIsReadonly( TRUE );
			$myattr->setDesc("Name");
			$myattr->setDesc($myattr->getDesc());
			$this->add($myattr);
		}
	}
	public function getItem ($index) // [int index]
	{
		return $this->get($index);
	}
	public function ToMapAttrs () 
	{
		$mapAttrs = new MapAttrs();
		foreach ($this as $item) 		{
			if (($item->getMyFieldType() == FieldType::$RefText))
				continue;
			$mattr = new MapAttr();
			$mattr->setKeyOfEn($item->getKey());
			$mattr->setName($item->getDesc());
			$mattr->setMyDataType($item->getMyDataType());
			$mattr->setUIContralType($item->getUIContralType());
			$mattr->setUIBindKey($item->getUIBindKey());
			$mattr->setUIWidth($item->getUIWidthInt());
			$mattr->setUIHeightInt($item->getUIHeight());
			$mattr->setMaxLen($item->getMaxLength());
			$mattr->setMinLen($item->getMinLength());
			$mattr->setUIVisible($item->getUIVisible());
			$mattr->setDefValReal($item->getDefaultValOfReal());
			$mattr->setUIIsEnable($item->getUIIsReadonly());
			if ((($item->getMyFieldType() == FieldType::$Normal) || ($item->getMyFieldType() == FieldType::$PK)))
			{
				if (((((((($item->getMyDataType() == $DataType->AppInt) || ($item->getMyDataType() == $DataType->AppFloat)) || ($item->getMyDataType() == $DataType->AppDouble)) || ($item->getMyDataType() == $DataType->AppMoney)) || ($item->getMyDataType() == $DataType->AppString)) || ($item->getMyDataType() == $DataType->AppDate)) || ($item->getMyDataType() == $DataType->AppDateTime)))
				{
					$mattr->setUIIsEnable(!$item->getUIIsReadonly());
				}
			}
			if (($item->UIIsLine ==  TRUE ))
				$mattr->setColSpan(3);
			$mattr->SetPara("HelpUrl", $item->HelperUrl);
			$mattr->setUIRefKeyText($item->getUIRefKeyText());
			$mattr->setUIRefKey($item->getUIRefKeyValue());
			if (($item->getMyFieldType() == FieldType::$Enum))
				$mattr->setLGType(FieldTypeS::$Enum);
			if (($item->getMyFieldType() == FieldType::$FK))
				$mattr->setLGType(FieldTypeS::$FK);
			$mapAttrs->AddEntity($mattr);
		}
		return $mapAttrs;
	}
}
Attrs::__staticinit(); // initialize static vars for this class on load
?>
